﻿using Styx;
using Styx.CommonBot;

using WuzzCollection.Helpers;

namespace WuzzCollection.Classes
{
    internal partial class Monk : AbstractClass
    {
        public void LowbieRotation()
        {
            // Tiger Palm for keeping up buff
            if ((!Helpers.Unit.HasMyAura(StyxWoW.Me, "Tiger Power") || Me.Auras["Tiger Power"].TimeLeft.Seconds < 5)
                && Me.CurrentChi >= 1 && Me.CurrentTarget.IsWithinMeleeRange)
                if (Spell.CastSpell("Tiger Palm"))
                    return;

            // Blackout Kick for damage when Tiger Power is at 3 stacks
            if (Me.CurrentChi >= 2 && Me.CurrentTarget.IsWithinMeleeRange)
                if (Spell.CastSpell("Blackout Kick"))
                    return;

            // Jab
            if (Me.CurrentEnergy >= 40 && Me.CurrentTarget.IsWithinMeleeRange)
                if (Spell.CastSpell("Jab"))
                    return;

            // Tiger Palm, for spending chi when energy is low? Only when no other Chi-spenders is learned?
            if (!SpellManager.Spells.ContainsKey("Blackout Kick")
                && Me.CurrentChi >= 1 && Me.CurrentTarget.IsWithinMeleeRange)
                if (Spell.CastSpell("Tiger Palm"))
                    return;
        }
    }
}
